<template>
  <div>
    <FilterTable
      ref="table"
      :columns="columns"
      :fetchapi="fetchApi"
      :params="fetchParams"
      :datakey="'records'"
      :isSelectColumn="false"
      :onColumnsChange="columns => this.columns = columns"
    >
    </FilterTable>

  </div>
</template>

<script>
import {getuserworkhourdetail} from '@/api/reportManage/salesAfter';
export default {
  name: "partOrder",
  props:{
    value: {
      name: Object,
      param: Object
    },
  },
  data(){
    return{
      fetchParams: {},
      columns:this.createdTable(),
      fetchApi: getuserworkhourdetail,
    }
  },
  created() {
    console.info(this.value.name)
    console.info(this.value.param)
    this.value.param.technician = this.value.name
    this.fetchParams = Object.assign({}, this.fetchParams, this.value.param );
  },
  mounted() {
    // 分页
    this.BaseTable = this.$refs.table.$refs.pageTable;
  },
  methods:{
    createdTable() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 80,
          sorter: true,
          render: props => {
            return <span>{props.row.index + 1}</span>;
          }
        },
        {
          title: '委托单号',
          dataIndex: 'ro_no',
          sorter: true
        },
        {
          title: '工时代码',
          dataIndex: 'labour_code',
          sorter: true
        },
        {
          title: '工时名称',
          dataIndex: 'labour_name',
          sorter: true
        },
        {
          title: '维修技师',
          dataIndex: 'technicianName',
          sorter: true
        }
      ]
    },
    closeDrawer(type){
      this.$emit('close')
    }
  }
}
</script>
